package com.fengye.spring.cloud.gateway.service.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 测试spring cloud gateway filters
 * @author sky
 * @date 2021年05月27日 10:44 上午
 */
@RestController
public class GateFilterTestController {

    /**
     * 获取filter中所有参数
     * @param request {@link HttpServletRequest}
     * @param response {@link HttpServletResponse}
     * @return 参数列表
     */
    @GetMapping("/filter")
    public Map<String, String[]> sayHello(HttpServletRequest request, HttpServletResponse response) {
        Map<String, String[]> parameterMap = request.getParameterMap();
        return parameterMap;
    }
}
